package com.gopay.bis.ccb.ebank.rsa;

import java.security.Security;
import java.security.Signature;

import netpay.merchant.crypto.ABAProvider;
import netpay.merchant.crypto.RSAPubKey;
import CCBSign.RSASig;

public class RsaSigForGopay extends RSASig {
	
	 public boolean verifySigature(String sign, String src)
	  {
	    try
	    {
	      Security.addProvider(new ABAProvider());
	      Signature sigEng = Signature.getInstance("MD5withRSA", "ABA");

	      byte[] pubbyte = hexStrToBytes(super.getPublicKey().trim());
	      sigEng.initVerify(new RSAPubKey(pubbyte));
	      sigEng.update(src.getBytes("gbk"));

	      byte[] sign1 = hexStrToBytes(sign);

	      return sigEng.verify(sign1);
	    }
	    catch (Exception localException)
	    {
	    }

	    return false;
	  }

}
